package com.rykj.qxj.apiService.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.rykj.qxj.apiService.exception.ApiIsDeleteException;
import com.rykj.qxj.apiService.exception.ApiIsDisableException;
import com.rykj.qxj.apiService.exception.ApiVersionIsDeleteException;
import com.rykj.qxj.apiService.exception.ApiVersionIsDisableException;
import com.rykj.qxj.apiService.exception.ApiVersionIsNotVerifyPassException;
import com.rykj.qxj.apiService.exception.AppKeyIsNotExistException;
import com.rykj.qxj.apiService.exception.AppKeyIsNotNullException;
import com.rykj.qxj.apiService.exception.ApplyIsNotCurrentApplyException;
import com.rykj.qxj.apiService.exception.ApplyIsNotOnException;
import com.rykj.qxj.apiService.exception.DatabaseSourceIsNullException;
import com.rykj.qxj.apiService.exception.DoAuthenticationFailException;
import com.rykj.qxj.apiService.exception.FileApiExpiresOSSAccessKeyIdSignatureIsNullException;
import com.rykj.qxj.apiService.exception.PageNoOrPageSizeNotRightException;
import com.rykj.qxj.apiService.exception.RequestParamIsNotMatchException;
import com.rykj.qxj.apiService.exception.RequestURIErrorException;
import com.rykj.qxj.result.BaseResponse;
import com.rykj.qxj.server.model.entity.ApiManage;
import com.rykj.qxj.server.model.entity.DatabaseSource;

public interface IDataApiService {
	/**
	 * @throws ApiVersionIsDeleteException 
	 * @throws ApiVersionIsNotVerifyPassException 
	 * @throws ApiVersionIsDisableException 
	 * @throws ApiIsDeleteException 
	 * @throws ApiIsDisableException 
	 * @throws ApplyIsNotOnException 
	 * @throws DatabaseSourceIsNullException 
	 * @throws IOException 
	 * @throws RequestParamIsNotMatchException 
	 * @throws DoAuthenticationFailException 
	 * @throws AppKeyIsNotNullException 
	 * 
	 * @Description: 添加数据接口服务  
	 * @param: request 请求参数信息     
	 * @param: request 响应参数信息     
	 * @date:   2019年5月7日 上午10:30:25  
	 * @author: wangshunyi    
	 * @throws
	 */
	 BaseResponse doPostService(HttpServletRequest request,HttpServletResponse response) throws AppKeyIsNotNullException, DoAuthenticationFailException, RequestParamIsNotMatchException,DatabaseSourceIsNullException, ApplyIsNotOnException, RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException;
	/**
	 * @throws ApiVersionIsDeleteException 
	 * @throws ApiVersionIsNotVerifyPassException 
	 * @throws ApiVersionIsDisableException 
	 * @throws ApiIsDeleteException 
	 * @throws ApiIsDisableException 
	 * @throws ApplyIsNotOnException 
	 * @throws RequestURIErrorException 
	 * @throws DatabaseSourceIsNullException 
	 * @throws RequestParamIsNotMatchException 
	 * @throws DoAuthenticationFailException 
	 * @throws AppKeyIsNotNullException 
	 * 
	 * @Description: 查询数据服务   
	 * @param: request 请求参数信息     
	 * @param: request 响应参数信息     
	 * @date:   2019年5月7日 上午10:30:29  
	 * @author: wangshunyi    
	 * @throws
	 */
	 PageInfo doGetService(HttpServletRequest request,HttpServletResponse response) throws Exception;
	 /**
	 * @throws ApiVersionIsDeleteException 
	 * @throws ApiVersionIsNotVerifyPassException 
	 * @throws ApiVersionIsDisableException 
	 * @throws ApiIsDeleteException 
	 * @throws ApiIsDisableException 
	 * @throws ApplyIsNotOnException 
	 * @throws RequestParamIsNotMatchException 
	 * @throws DoAuthenticationFailException 
	 * @throws AppKeyIsNotNullException 
	 * @throws IOException 
	 * @throws DatabaseSourceIsNullException 
	  * 
	  * @Description: 修改数据服务
	  * @param: request 请求参数信息     
	  * @param: request 响应参数信息     
	  * @date:   2019年5月7日 上午10:30:32  
	  * @author: wangshunyi    
	  * @throws
	  */
	 BaseResponse doPutService(HttpServletRequest request,HttpServletResponse response) throws DatabaseSourceIsNullException, AppKeyIsNotNullException, DoAuthenticationFailException, RequestParamIsNotMatchException, ApplyIsNotOnException, RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException;
	 /**
	 * @throws ApiVersionIsDeleteException 
	 * @throws ApiVersionIsNotVerifyPassException 
	 * @throws ApiVersionIsDisableException 
	 * @throws ApiIsDeleteException 
	 * @throws ApiIsDisableException 
	 * @throws ApplyIsNotOnException 
	 * @throws DoAuthenticationFailException 
	 * @throws RequestParamIsNotMatchException 
	 * @throws DatabaseSourceIsNullException 
	 * @throws IOException 
	 * @throws AppKeyIsNotNullException 
	  * 
	  * @Description: 删除数据服务   
	  * @param: request 请求参数信息     
	  * @param: response 响应参数信息      
	  * @date:   2019年5月7日 上午10:30:35  
	  * @author: wangshunyi    
	  * @throws
	  */
	 BaseResponse doDeleteService(HttpServletRequest request,HttpServletResponse response) throws AppKeyIsNotNullException,DatabaseSourceIsNullException, RequestParamIsNotMatchException, DoAuthenticationFailException, ApplyIsNotOnException, RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException;
	 /**
	 * @throws ApiVersionIsDeleteException 
	 * @throws ApiVersionIsNotVerifyPassException 
	 * @throws ApiVersionIsDisableException 
	 * @throws ApiIsDeleteException 
	 * @throws ApiIsDisableException 
	 * @throws RequestURIErrorException 
	  * 
	  * @Description: 文件接口返回文件流  
	  * @param: request 请求参数信息     
	  * @param: response 响应参数信息       
	  * @date:   2019年7月26日 下午2:19:06  
	  * @author: wangshunyi    
	  * @throws
	  */
	void doGetFileService(HttpServletRequest request, HttpServletResponse response)throws AppKeyIsNotNullException, ApplyIsNotOnException, FileApiExpiresOSSAccessKeyIdSignatureIsNullException, DoAuthenticationFailException, RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException,IOException;
	 /**
	 * @throws ApplyIsNotCurrentApplyException 
	 * @throws RequestParamIsNotMatchException 
	 * @throws DatabaseSourceIsNullException 
	 * @throws IOException 
	 * @throws ApiVersionIsDeleteException 
	 * @throws ApiVersionIsNotVerifyPassException 
	 * @throws ApiVersionIsDisableException 
	 * @throws ApiIsDeleteException 
	 * @throws ApiIsDisableException 
	 * @throws RequestURIErrorException 
	 * @throws ApplyIsNotOnException  
	 * @Description: 添加数据服务   
	 * @param: request 请求参数信息     
	 * @param: request 响应参数信息     
	 * @date:   2019年5月7日 上午10:30:29  
	 * @author: wangshunyi    
	 * @throws
	 */
	 BaseResponse doPostServiceByAppKey(HttpServletRequest request,HttpServletResponse response) throws AppKeyIsNotNullException, AppKeyIsNotExistException, ApplyIsNotOnException, RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException, IOException, DatabaseSourceIsNullException, RequestParamIsNotMatchException, ApplyIsNotCurrentApplyException;
		 /**
		 * @throws PageNoOrPageSizeNotRightException 
		 * @throws ApplyIsNotCurrentApplyException 
		 * @throws DatabaseSourceIsNullException 
		 * @throws RequestParamIsNotMatchException 
		 * @throws DoAuthenticationFailException 
		 * @throws ApiVersionIsDeleteException 
		 * @throws ApiVersionIsNotVerifyPassException 
		 * @throws ApiVersionIsDisableException 
		 * @throws ApiIsDeleteException 
		 * @throws ApiIsDisableException 
		 * @throws RequestURIErrorException 
		 * @throws ApplyIsNotOnException 
		 * @throws AppKeyIsNotExistException 
		 * @throws AppKeyIsNotNullException  
		 * @Description: 查询数据服务   
		 * @param: request 请求参数信息     
		 * @param: request 响应参数信息     
		 * @date:   2019年5月7日 上午10:30:29  
		 * @author: wangshunyi    
		 * @throws
		 */
	 PageInfo doGetServiceByAppKey(HttpServletRequest request,HttpServletResponse response,ApiManage apiManage ) throws Exception;
     /**
     * @throws ApplyIsNotCurrentApplyException 
     * @throws RequestParamIsNotMatchException 
     * @throws DatabaseSourceIsNullException 
     * @throws IOException 
     * @throws ApiVersionIsDeleteException 
     * @throws ApiVersionIsNotVerifyPassException 
     * @throws ApiVersionIsDisableException 
     * @throws ApiIsDeleteException 
     * @throws ApiIsDisableException 
     * @throws RequestURIErrorException 
     * @throws ApplyIsNotOnException 
     * @throws AppKeyIsNotExistException 
     * @throws AppKeyIsNotNullException 
	  * @Description: 修改数据服务
	  * @param: request 请求参数信息     
	  * @param: request 响应参数信息     
	  * @date:   2019年5月7日 上午10:30:32  
	  * @author: wangshunyi    
	  * @throws
	  */
	 BaseResponse doPutServiceByAppKey(HttpServletRequest request,HttpServletResponse response) throws AppKeyIsNotNullException, AppKeyIsNotExistException, ApplyIsNotOnException, RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException, IOException, DatabaseSourceIsNullException, RequestParamIsNotMatchException, ApplyIsNotCurrentApplyException;
	 /**
	 * @throws ApplyIsNotCurrentApplyException 
	 * @throws RequestParamIsNotMatchException 
	 * @throws DatabaseSourceIsNullException 
	 * @throws IOException 
	 * @throws ApiVersionIsDeleteException 
	 * @throws ApiVersionIsNotVerifyPassException 
	 * @throws ApiVersionIsDisableException 
	 * @throws ApiIsDeleteException 
	 * @throws ApiIsDisableException 
	 * @throws RequestURIErrorException 
	 * @throws ApplyIsNotOnException 
	 * @throws AppKeyIsNotExistException 
	 * @throws AppKeyIsNotNullException 
	  * @Description: 删除数据服务   
	  * @param: request 请求参数信息     
	  * @param: response 响应参数信息      
	  * @date:   2019年5月7日 上午10:30:35  
	  * @author: wangshunyi    
	  * @throws
	  */
	 BaseResponse doDeleteServiceByAppKey(HttpServletRequest request,HttpServletResponse response) throws AppKeyIsNotNullException, AppKeyIsNotExistException, ApplyIsNotOnException, RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException, IOException, DatabaseSourceIsNullException, RequestParamIsNotMatchException, ApplyIsNotCurrentApplyException;
	 /**
	 * @throws ApplyIsNotCurrentApplyException 
	 * @throws IOException 
	 * @throws ApiVersionIsDeleteException 
	 * @throws ApiVersionIsNotVerifyPassException 
	 * @throws ApiVersionIsDisableException 
	 * @throws ApiIsDeleteException 
	 * @throws ApiIsDisableException 
	 * @throws RequestURIErrorException 
	 * @throws ApplyIsNotOnException 
	 * @throws AppKeyIsNotExistException 
	 * @throws AppKeyIsNotNullException 
	  * @Description: 文件接口返回文件流  
	  * @param: request 请求参数信息     
	  * @param: response 响应参数信息       
	  * @date:   2019年7月26日 下午2:19:06  
	  * @author: wangshunyi    
	  * @throws
	  */
	void doGetFileServiceByAppKey(HttpServletRequest request, HttpServletResponse response) throws AppKeyIsNotNullException, AppKeyIsNotExistException, ApplyIsNotOnException, RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException, IOException, ApplyIsNotCurrentApplyException;
	
	
	
	Object doGetOutSideService(HttpServletRequest request, HttpServletResponse response) throws AppKeyIsNotNullException, AppKeyIsNotExistException, ApplyIsNotOnException, ApplyIsNotCurrentApplyException, RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException;

	 ApiManage getApiManage(String requestURI, String method) throws RequestURIErrorException, ApiIsDisableException, ApiIsDeleteException, ApiVersionIsDisableException, ApiVersionIsNotVerifyPassException, ApiVersionIsDeleteException ;
	 void checkAppkey(String appKey) throws AppKeyIsNotNullException, AppKeyIsNotExistException, ApplyIsNotOnException, ApplyIsNotCurrentApplyException;

	/**
	 * redis接口查询数据
	 * @param apiManage
	 * @return
	 */
	Object doGetServiceByAppKeyRedis(ApiManage apiManage, DatabaseSource databaseSource, JSONObject jsonParam) throws AppKeyIsNotNullException, ApplyIsNotOnException, AppKeyIsNotExistException, ApplyIsNotCurrentApplyException;
}
